#include <stdio.h>
#include <stdlib.h>

struct TreeNode {
    int val;
    struct TreeNode *left;
    struct TreeNode *right;
};

void inorder(struct TreeNode *root, int *arr, int* arrSize){
    if(!root){
        return;
    }
    inorder(root->left, arr, arrSize);
    arr[(*arrSize)++] = root->val;
    inorder(root->right, arr, arrSize);
}

int* inorderTraversal(struct TreeNode* root, int* returnSize){
    int *arr = (int *)malloc(sizeof(int) * 101);
    *returnSize = 0;
    inorder(root, arr, returnSize);
    return arr;
}
